<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:useBean id="db" class="ctm.javacode.dbBean"/>
<%@page import ="java.sql.*" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>中醫體質評量系統</title>
<script language="Javascript" type="text/javascript">
function setradiobutton(Name,val){
	var obj = document.getElementsByName(Name);
	for (var i=0 ; i<obj.length ; i++){
		if (obj[i].value == val)
			obj[i].checked = true;
	}
}
</script>
<style type="text/css">
<!--
body {
	background-image: url(img/grass.jpg);
    background-position: center top;
	background-color: #FFFFFF;
	background-repeat: repeat;
}
body,td,th {
	color: #000000;
	font-size:24px;
	font-family: Arial;
}

.BOTTOM_STYLE {
	color: #FFFFFF; 
	font-family: Arial; 
	font-size:20px;
}
a:link {
text-decoration:none;
font-family:Arial;
font-size:20px;
color:#FFFFFF;
}
a:visited {
text-decoration:none;
font-family:Arial;
font-size:20px;
color:#FFFFFF;
}
a:hover {
text-decoration:none;
font-family:Arial;
font-size:20px;
color:#000000;
}


.ind:link {
color: #535353;
text-decoration:none;
font-family:"標楷體";
font-size:18px;
}
.ind:visited {
color:#535353;
text-decoration:none;
font-family:"標楷體";
font-size:18px;
}

.ind:hover {
color:#BB280F;
text-decoration:none;
font-family:"標楷體";
font-size:18px;
}


.HEAD_STYLE {
	font-weight:bold;
	color: #437A27;
	font-family:Arial;
	font-size:30px; 
}
.HEAD_STYLE {
	font-weight:bold;
	color: #1B4001;
	font-family:"標楷體";
	font-size:30px; 
}
.TEXT_STYLE {
	font-family:Arial;
	color:#193940;
	font-size:24px;
	font-weight:bold;
}
.LEFT_BUTTON {
	font-family:"標楷體"; 
	font-size:18px;
}

form,input{margin:0; padding:0; color:#437A27;}
div.box {
	;
	margin-top: auto;
	margin-bottom: auto;
	width: 100%;
	border-top-width: 3\;
	border-right-width: 2px;
	border-bottom-width: 5px;
	border-left-width: 2px;
	border-top-style: outset;
	border-right-style: outset;
	border-bottom-style: outset;
	border-left-style: outset;
	border-top-color: #CCCCCC;
	border-right-color: #CCCCCC;
	border-bottom-color: #CCCCCC;
	border-left-color: #CCCCCC;
	border-top-width: 2px;
	border-right-width: 5px;
}

div.box label {
	width:100%;
	display: block;
	padding-top: 5px;
	padding-bottom: 5px;
}
div.box span {
	display: block;
	color:#193940;
	font-size:24px;
	float:left;
	text-align:left;
	padding-top: 1px;
	padding-bottom: 1px;
	padding-left: 15%;
	padding-right: 1px;
	width: 40%;
	font-weight:bold;
}
div.box .title {
	display: block;
	color:#437A27;
	font-size:24px;
	float:left;
	text-align:left;
	padding-top: 1px;
	padding-bottom: 1px;
	padding-left: 15%;
	padding-right: 1px;
	width: 20%;
	font-weight:bold;
}

div.box .input_text {
	background-color: #FFFFFF;
	height: 24px;
	border: 2px inset #63B63A;
	width: 35%;
	font-size: 20px;
}

div.box .button
{
	border:0px;
	padding-top: 4px;
	padding-right: 7px;
	padding-bottom: 4px;
	padding-left: 7px;
	background-color: #468129;
	color: #FFFFFF;
}


-->
</style>

</head>
<body alink="#FF0000" vlink="#FF0000">
<%
	db.setDataSource("jdbc/ctmpllab");
	db.Connected();
	String name = (String)request.getSession().getAttribute("login");
	String mail="";
	String username="";
	String height="";
	String weight="";
	String sqlQuery = "select * from accounttable where ACCOUNT = '" + name + "'";
	ResultSet rs;
	rs = db.ExcuteQuery(sqlQuery);
	rs.next();
	mail = rs.getString("email");
	username = rs.getString("name");
	height = rs.getString("height");
	weight = rs.getString("weight");
	String education = rs.getString("education");
	String marriage = rs.getString("marriage");
	String job = rs.getString("job");
	String liveWith = rs.getString("liveWith");
%>
<table width="100%" border="0">
		<tr>
			<td><p>&nbsp;</p></td>
		</tr>
				
			
			
		
 
    		<td width="5%">&nbsp;</td>
			
			<td bgcolor="#FFFFFF"><table width="100%" border="0">
      			<tr>
        			<td background="img/herbal.jpg">
						<p>&nbsp;</p>
          				<p>&nbsp;</p>
          				<p>&nbsp;</p>
          				<p>&nbsp;</p>
		  				<p>&nbsp;</p>
          
          			</td>
			  </tr>
     
	 
	 
	 
	  			  <tr>
        			<td>	
						<table bgcolor="#437A27" width="100%" border="0">
         					 <tr>
            					<td>&nbsp;</td>
								<td width="20%" align="center"><a href="main.jsp" target="_parent">回到主選單</a></td>
           			 			
          			 		</tr>
        				</table>
					</td>
     			  </tr>
      
	  			
	  
	  
	  
	 			  <tr>
        				<td>
							<table width="100%">
           						<tr>
									<td valign="top">
										<table width="100%">
											
											<tr>
												<td align="center" class="HEAD_STYLE">修改基本資料</td>
												
											</tr>

										
											
											<tr>
												
												<td>
													<table width="100%"><td width="10%"> </td>
													<td >
													
													<form name="editdataform" action="editData.do" method="post">
													<div class="box">
													
													<label><span class="title">使用者名稱:</span>
													<input class="input_text"type="text" name="username"
													 size="15" value="<%=username%>">
													</label>
													
													
													<label><span class="title">E-mail:</span>
													<input class="input_text"type="text" name="mail"
													 size="25" value="<%=mail%>">
													</label>
													
													
													<label><span class="title">身高(cm):</span>
													<input class="input_text"type="text" name="height"
													 size="25" value="<%=height%>">
													</label>
													
													
													<label><span class="title">體重(kg):</span>
													<input class="input_text"type="text" name="weight"
													 size="25" value="<%=weight%>">
													</label>
													
													<label><span class="title">教育程度:</span>																											
														<input type="radio" name="education" value="no" />不識字
														&nbsp;
														<input type="radio" name="education" value="elementary" />國小
													 	&nbsp;
														<input type="radio" name="education" value="junior" />國中
														&nbsp;
														<input type="radio" name="education" value="high" />高中
														&nbsp;
														<input type="radio" name="education" value="college" />大專以上
														<script> setradiobutton('education','<%=education%>'); </script> 													
													</label>
													
													<label><span class="title">婚姻狀況:</span> 														 
														<input type="radio" name="marriage" value="single" />未婚
														&nbsp;
														<input type="radio" name="marriage" value="marriedLive" />已婚同居
														&nbsp; 
														<input type="radio" name="marriage" value="marriedNonlive" />已婚分居
														&nbsp; 
														<input type="radio" name="marriage" value="divorce" />離婚
														&nbsp; 												 
														<input type="radio" name="marriage" value="widow" />喪偶
														<script> setradiobutton('marriage','<%=marriage%>'); </script> 																		
													</label>
													
													<label><span class="title">職業:</span> 	 
														<input type="radio" name="job" value="no" />無
														&nbsp; 
														<input type="radio" name="job" value="yes" />有
														<script> setradiobutton('job','<%=job%>'); </script> 
													</label>
													
													<label><span class="title">居住狀況:</span> 	 
														<input type="radio" name="liveWith" value="alone" />獨居
														&nbsp; 
														<input type="radio" name="liveWith" value="family" />與家人住
														&nbsp; 
														<input type="radio" name="liveWith" value="friends" />與朋友住
														<script> setradiobutton('liveWith','<%=liveWith%>'); </script> 
													</label>																															
													
													<center>
													<input  class="button"name="submit" type="submit" value="送出 ">&nbsp;
													<input type="button" value="取消" onclick="window.location='main.jsp'" class="button" /></center>
													
													</div>
													</form>
													</td>
													<td width="10%"> </td>
													</table>
												</td>
												
											</tr>
										
										</table>													

<%

%>													
										
												
												
										
									
             

		
											
								  </td>
									

								</tr>
       					 </table>
         

         				</td>
			  </tr>
   
	  
					 <tr>
      					  
   					    <td><p>&nbsp;</p></td>
  					 </tr>
	  				
					<tr>
      					  <td bgcolor="#437A27"><div align="center" class="BOTTOM_STYLE">Copyright@ITRI and CCU_PLlab</div></td>
   
			  </tr>
    						
  	 			  
	
			</table>
		</td>
	    
		<td width="5%">&nbsp;</td>
</table>
<p>&nbsp;</p>
</body>
</html>
